﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KS
{
    public struct Key
    {
        public string Value { get; set; }
        public int Row { get; set; }
        public int Col { get; set; }
        public bool IsVowel { get; set; }
        public List<Key> NextLegalMoves { get; set; }


        public Key(string value) : this()
        {
            Value = value;
        }


        public override string ToString()
        {
            return Value;
        }


        public override bool Equals(Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return false;
            }

            // If parameter cannot be cast to Point return false.
            Key p = (Key)obj;
            if ((Object) p == null)
            {
                return false;
            }

            // Return true if the fields match:
            return p.Value == Value;
        }

        public bool Equals(Key p)
        {
            // If parameter is null return false:
            if ((object)p == null)
            {
                return false;
            }

            // Return true if the fields match:
            return p.Value == Value;
        }

        public override int GetHashCode()
        {
            return Value.ToString().GetHashCode(); 
        }

    }
}
